package crm.copy;

import java.util.Scanner;

public class DealCommand {
	
	public void dealCommand(DataHand dh,String commandKind,String[] strCommand,Scanner input){
		
		switch(commandKind){		    
	    case "L"      : dh.lookCRM(); break;
	    case "L id"   : dh.lookByIdCRM(StringHandle.getId(strCommand[2]));break;
	    case "L name" : dh.lookByNameCRM(StringHandle.getName(strCommand[2]));break;
	    case "A"      : dh.addCRM(StringHandle.getCustomer(strCommand[1]));break;
	    case "D id"   : dh.deleteCRM(StringHandle.getId(strCommand[1])); break;
	    case "U id"   : dh.updateCRM(StringHandle.getId(strCommand[1]), StringHandle.getCustomer(strCommand[2]));break;
	    case "O id"   : dh.sortByIdCRM();break;
	    case "O name" : dh.sortByNameCRM(); break;
	    case "H"      : break;
	    case "Q"      : input.close();break;
	    case "None"   : break;
	    default       : break;
	    }
	    System.out.println();
	}
	

}
